{% extends 'myadmin/index.html' %}

{% block title %}
    <title>后台-订单详情</title>
{% endblock %}

{% block con %}
<div class="row-content am-cf">
    <div class="row">
        <div class="am-u-sm-12 am-u-md-12 am-u-lg-12">
            <div class="widget am-cf">
                <div class="widget-head am-cf">
                    <div class="widget-title  am-cf">订单详情 </div>
                </div>
                <div class="widget-body  am-fr">

                    <div class="am-u-sm-12 am-u-md-6 am-u-lg-6">
                        <div class="am-form-group">
                            <div class="am-btn-toolbar">
                              
                            </div>
                        </div>
                    </div>
                    <form>
                        <div class="am-u-sm-12 am-u-md-6 am-u-lg-3">
                            <div class="am-form-group tpl-table-list-select">
                                <select name="types" data-am-selected="{btnSize: 'sm'}" style="display: none;">
                                  <option value="all"{% if request.GET.types == 'all' %} selected {% endif %}>所有类别</option>
                                  <option value="id"{% if request.GET.types == 'id' %} selected {% endif %}>ID</option>
                                  <option value="username"{% if request.GET.types == 'username' %} selected {% endif %}>用户名</option>
                                  <option value="phone"{% if request.GET.types == 'phone' %} selected {% endif %}>手机号</option>
                                  <option value="email"{% if request.GET.types == 'email' %} selected {% endif %}>电子邮件</option>
                                  <option value="age"{% if request.GET.types == 'age' %} selected {% endif %}>年龄</option>
                                  <option value="status"{% if request.GET.types == 'status' %} selected {% endif %}>状态</option>
                                </select>
                            </div>
                        </div>
                        <div class="am-u-sm-12 am-u-md-12 am-u-lg-3">
                            <div class="am-input-group am-input-group-sm tpl-form-border-form cl-p">
                                <input type="text" value="{{ request.GET.keywords }}" name="keywords" class="am-form-field ">
                                <span class="am-input-group-btn">
                                    <button class="am-btn  am-btn-default am-btn-success tpl-table-list-field am-icon-search"></button>
                                  </span>
                            </div>
                        </div>
                    </form>

                    <div class="am-u-sm-12">
                        <table width="100%" class="am-table am-table-compact am-table-striped tpl-table-black ">
                            <thead>
                                <tr>
                                    <th>订单ID</th>
                                    <th>商品ID</th>
                                    <th>商品图片</th>
                                    <th>商品单价</th>
                                    <!-- <th>收货地址</th> -->
                                    <th>商品数量</th>
                                    <th>收货地址</th>
                                    <th>操作</th>
                                </tr>
                            </thead>
                            <tbody>
                       
                                <tr>
                                    {% for v in data.orderinfo_set.all %}
                                    <td>{{ data.id }}</td>
                                    <td class="am-text-middle">{{ v.goodsid }}</td>
                                    <td class="am-text-middle">
                                        <img src="{{ v.pic_url }}" width="100">
                                    </td>
                                    <!-- <td class="am-text-middle">{{ v.shdz }}</td> -->
                                    <td class="am-text-middle">{{ v.price }}</td>
                                    <td class="am-text-middle">{{ v.num }}</td>
                     
                                    <td class="am-text-middle">{{ data.shdz }}</td>
                                    <td class="am-text-middle">
                                        <div class="tpl-table-black-operation">
                                            <a href="{% url 'myadmin_order_index' %}" class="tpl-table-black-operation-del">
                                                <i class="am-icon-pencil"></i> 返回订单列表
                                            </a>
                                           <!--  <a href="" class="tpl-table-black-operation-del">
                                                <i class="am-icon-trash"></i> 删除
                                            </a> -->
                                        </div>
                                    </td>
                                </tr>
                                    {% endfor %}
                         
         
                                <!-- more data -->
                            </tbody>
                        </table>
                    </div>
                    <div class="am-u-lg-12 am-cf">

                        <div class="am-fr">
                            <ul class="am-pagination tpl-pagination">
                            
                            </ul>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<script type="text/javascript">
    $('.status').change(function(){
        //获取当前元素的id编号
        var id=$(this).prev().text()
        var status=$(this).val()
        $.get('{% url 'myadmin_order_edit' %}',{'id':id,'status':status},function(data){if(data['error']==1){alert(data['msg'])}},'json')
    })
</script>
{% endblock %}